<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('新增时间活动')}" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-activitie-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">名称：</label>
                    <div class="col-sm-8">
                        <input name="name" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">状态：</label>
                    <div class="col-sm-8">
						<label class="toggle-switch switch-solid">
						    <input type="checkbox" id="status" th:value="1" checked>
						    <span></span>
						</label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:insert="~{include :: footer}" />
    <script th:inline="javascript">
        var prefix = ctx + "project/activitie"
        $("#form-activitie-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
				var data = $("#form-activitie-add").serializeArray();
				var status = $("input[id='status']").is(':checked') == true ? 1 : 0;
				data.push({"name": "status", "value": status});
                $.operate.save(prefix + "/add", data);
            }
        }
    </script>
</body>
</html>